package demo1;

/**
 * @Author 12629
 * @Description：
 */
class Base {
    public int a = 1;
    public int b = 2;
    public int d = 99;

    public void func1() {
        System.out.println("func1()");
    }
}
class Derived extends Base {
    public int c = 3;
    public int a = 4;

    public void func2() {
        System.out.println("func2()");
    }

    public void func1(int a) {
        System.out.println("func1(int)");
    }

    public void func1() {
        System.out.println("func1(int)");
    }

    public  void testFunc() {
        func2();
        func1(10);//子类的   重载！！
        func1();//子类的
        super.func1();//子类的
    }


    public void method() {
        /*a = 10;//这里的a子类 还是父类的a呢？？
        b = 20;
        c = 30;*/
        System.out.println(super.a);
        System.out.println(this.a);
        System.out.println(this.b);
        System.out.println(this.c);
        System.out.println(this.d);
        System.out.println("=================");
        System.out.println(super.a);
        System.out.println(super.b);
        System.out.println(super.d);

        System.out.println(this.a);//子类的
        System.out.println(this.b);
        System.out.println(this.d);
        System.out.println(this.c);

    }
}
public class Test2 {

    public static void main(String[] args) {
        Derived derived = new Derived();
    }
}
